ObjectDB Database Search
51-100 of 200 resultsJPA Query API Jakarta Persistence (JPA) represents queries with two interfaces: the Query interface, which was the only query interface in JPA 1, and the TypedQuery interface, which was introduced in JPA 2 ... is preferred. Using TypedQuery with ObjectDB has another advantage. In the context of the preceding | |
CRUD Database Operations with JPA Given an EntityManager instance, em , which manages the persistence context for the database, you can use it to store, retrieve, update, and delete objects. Storing new entities The following code fragment stores 1,000 Point objects in the database: em. getTransaction (). begin (); for (int i = 0 | |
UPDATE SET Queries in JPA/JPQL its persistence context . Therefore, we recommend using a separate EntityManager for UPDATE queries. As with any | |
jakarta.persistence.EntityManager.merge(T) context , resulting in, respectively, an insert or possible update when the persistence context ... to this persistence context , and has not been marked for removal, it is itself ignored, but the operation ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T merge ( T | |
jakarta.persistence.PersistenceUnitUtil.load(Object,String) persistent attribute of an entity belonging to the persistence unit and to an open persistence context ... with an open persistence context or cannot be loaded from the database. Since: Jakarta Persistence (JPA) 3.2 ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (   | |
jakarta.persistence.PersistenceUnitUtil.load(E,Attribute) attribute of an entity belonging to the persistence unit and to an open persistence context ... persistence context or cannot be loaded from the database. Since: Jakarta Persistence (JPA) 3.2 ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (   | |
jakarta.persistence.PersistenceUnitUtil.isInstance(Object,Class) belonging to the persistence unit and to an open persistence context is an instance of the given entity ... to the persistence unit. PersistenceException - if the entity is not associated with an open persistence context ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil boolean isInstance | |
jakarta.persistence.PersistenceUnitUtil.load(Object) and to an open persistence context . After this method returns, PersistenceUnitUtil.isLoaded must return true ... to the persistence unit. PersistenceException - if the entity is not associated with an open persistence context ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (   | |
jakarta.persistence.PersistenceUnitUtil.getClass(T) unit and to an open persistence context . This method may, but is not required to, load the given ... with an open persistence context or cannot be loaded from the database. Since: Jakarta Persistence (JPA) 3.2 ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil Class getClass (   | |
jakarta.persistence.EntityManager.find(EntityGraph,Object,FindOption...) type. If the entity instance is contained in the persistence context , it is returned from there. If the entity is found within the persistence context and the lock mode type is pessimistic ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T find (   | |
jakarta.persistence.EntityManager.find(Class,Object,FindOption...) it with respect to the specified lock type. If the entity instance is contained in the persistence context , it is returned from there. If the entity is found within the persistence context and the lock mode type ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T find ( Class | |
jakarta.persistence.EntityManager.find(Class,Object,LockModeType) is contained in the persistence context , it is returned from there, and the effect of this method ... within the persistence context and the lock mode type is pessimistic and the entity has a version ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T find ( Class | |
jakarta.persistence.EntityManager.find(Class,Object,LockModeType,Map). If the entity instance is contained in the persistence context , it is returned from there. If the entity is found within the persistence context and the lock mode type is pessimistic and the entity ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T find ( Class | |
jakarta.persistence.PersistenceContext.type Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceContext PersistenceContextType type (Optional) Specifies whether a transaction-scoped persistence context or an extended persistence context is to be used. Default: PersistenceContextType.TRANSACTION Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.PersistenceContext.synchronization Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceContext SynchronizationType synchronization (Optional) Specifies whether the persistence context is always automatically synchronized with the current transaction or whether the persistence context must be explicitly joined | |
jakarta.persistence.EntityManager.contains(Object) to the current persistence context . Parameters: entity - entity instance Returns: boolean value indicating if entity belongs to the persistence context . Throws: IllegalArgumentException - if not an entity. Since: Jakarta Persistence (JPA) 1.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager boolean contains (   | |
jakarta.persistence.EntityManager.detach(Object) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void detach ( Object entity ) Evict the given managed or removed entity from the persistence context , causing ... associated with this persistence context , it is ignored. Parameters: entity - a managed or removed | |
jakarta.persistence.TypedQuery.getResultStream() other than NONE has been set and there is no transaction or the persistence context has not been joined ... Jakarta Persistence (JPA) Method in jakarta. persistence .TypedQuery Stream getResultStream ... to getResultList().stream() , however, persistence provider may choose to override this method | |
jakarta.persistence.Query.getResultStream() and there is no transaction or the persistence context has not been joined to the transaction ... Jakarta Persistence (JPA) Method in jakarta. persistence .Query Stream getResultStream() Execute ... to getResultList().stream() , however persistence provider may choose to override this method | |
jakarta.persistence.TypedQuery.getSingleResult() and there is no transaction or the persistence context has not been joined to the transaction. Since: Jakarta Persistence (JPA) 1.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence .TypedQuery X getSingleResult() Execute ... : IllegalStateException - if called for a Jakarta Persistence query language UPDATE or DELETE statement | |
jakarta.persistence.TypedQuery.getSingleResultOrNull() and there is no transaction or the persistence context has not been joined to the transaction. Since: Jakarta Persistence (JPA) 3.2 ... Jakarta Persistence (JPA) Method in jakarta. persistence .TypedQuery X getSingleResultOrNull ... if there is no result. Throws: IllegalStateException - if called for a Jakarta Persistence query | |
jakarta.persistence.TypedQuery.getResultList() - if a lock mode other than NONE has been set and there is no transaction or the persistence context has not ... Jakarta Persistence (JPA) Method in jakarta. persistence .TypedQuery List getResultList() Execute ... for a Jakarta Persistence query language UPDATE or DELETE statement. PessimisticLockException | |
jakarta.persistence.EntityManager.lock(Object,LockModeType,LockOption...) an entity instance belonging to the persistence context , obtaining the specified lock mode , using ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void lock (   ... attribute, the persistence provider must also perform optimistic version checks when obtaining | |
jakarta.persistence.EntityManager.lock(Object,LockModeType) to the persistence context , obtaining the specified lock mode . If a pessimistic lock mode type is specified and the entity contains a version attribute, the persistence provider must also perform optimistic version ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void lock (   | |
jakarta.persistence.EntityManager.lock(Object,LockModeType,Map) instance belonging to the persistence context , obtaining the specified lock mode , using the specified ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void lock (   ... , the persistence provider must also perform optimistic version checks when obtaining the database | |
jakarta.persistence.EntityManager.clear() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void clear() Clear the persistence context , causing all managed entities to become detached. Changes made to entities that have not already been flushed to the database will never be made persistent . Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.Query.getSingleResultOrNull() the persistence context has not been joined to the transaction. Since: Jakarta Persistence (JPA) 3.2 ... Jakarta Persistence (JPA) Method in jakarta. persistence .Query Object getSingleResultOrNull ... if there is no result. Throws: IllegalStateException - if called for a Jakarta Persistence query language UPDATE or | |
jakarta.persistence.Query.executeUpdate() Jakarta Persistence (JPA) Method in jakarta. persistence .Query int executeUpdate() Execute ... : IllegalStateException - if called for a Jakarta Persistence query language SELECT statement or for a criteria query ... and the transaction is rolled back. TransactionRequiredException - if there is no transaction or the persistence | |
jakarta.persistence.Query.getResultList() other than NONE has been set and there is no transaction or the persistence context has not been joined ... Jakarta Persistence (JPA) Method in jakarta. persistence .Query List getResultList() Execute ... an empty list if there are no results. Throws: IllegalStateException - if called for a Jakarta Persistence | |
jakarta.persistence.Query.getSingleResult() and there is no transaction or the persistence context has not been joined to the transaction. Since: Jakarta Persistence (JPA) 1.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence .Query Object getSingleResult() Execute ... - if called for a Jakarta Persistence query language UPDATE or DELETE statement | |
jakarta.persistence.StoredProcedureQuery.executeUpdate() back. TransactionRequiredException - if there is no transaction or the persistence context has not been joined ... Jakarta Persistence (JPA) Method in jakarta. persistence .StoredProcedureQuery int executeUpdate ... value set and only the statement is rolled back. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.PersistenceContextType.TRANSACTION Jakarta Persistence (JPA) Enum Constant in jakarta. persistence .PersistenceContextType TRANSACTION Transaction-scoped persistence context Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.PersistenceContextType.EXTENDED Jakarta Persistence (JPA) Enum Constant in jakarta. persistence .PersistenceContextType EXTENDED Extended persistence context Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.joinTransaction() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void joinTransaction() Indicate to the entity manager that a JTA transaction is active and join the persistence context ... - if there is no active transaction. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.close() is joined to an active transaction, the persistence context remains managed until the transaction completes. Throws: IllegalStateException - if the entity manager is container-managed. Since: Jakarta Persistence (JPA) 1.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void close() Close | |
jakarta.persistence.EntityManager.runWithConnection(ConnectionConsumer) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void runWithConnection ... with a transaction, the action is executed in the context of the transaction. The given action should close ... back the transaction. If the given action throws an exception, the persistence provider must mark | |
jakarta.persistence.EntityManager.callWithConnection(ConnectionFunction) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T callWithConnection (   ... is executed in the context of the transaction. The given function should close any resources it creates ... action throws an exception, the persistence provider must mark the transaction for rollback. Parameters | |
jakarta.persistence.EntityManager.setFlushMode(FlushModeType) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void setFlushMode ( FlushModeType flushMode ) Set the flush mode that applies to all objects contained in the persistence context . Parameters: flushMode - flush mode Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.getFlushMode() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager FlushModeType getFlushMode() Get the flush mode that applies to all objects contained in the persistence context . Returns: the current FlushModeType . Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.getLockMode(Object) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager LockModeType getLockMode ( Object entity ) Get the current lock mode held by this persistence context on the given ... if the entity manager has not been joined to the current transaction. Since: Jakarta Persistence (JPA) 2.0 | |
jakarta.persistence.EntityManager.setCacheRetrieveMode(CacheRetrieveMode) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void setCacheRetrieveMode ( CacheRetrieveMode cacheRetrieveMode ) Set the default cache retrieval mode for this persistence context . Parameters: cacheRetrieveMode - cache retrieval mode Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.EntityManager.setCacheStoreMode(CacheStoreMode) Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void setCacheStoreMode ( CacheStoreMode cacheStoreMode ) Set the default cache storage mode for this persistence context . Parameters: cacheStoreMode - cache storage mode Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.EntityManager.getCacheRetrieveMode() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager CacheRetrieveMode getCacheRetrieveMode() The cache retrieval mode for this persistence context . Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.EntityManager.getCacheStoreMode() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager CacheStoreMode getCacheStoreMode() The cache storage mode for this persistence context . Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.SynchronizationType.SYNCHRONIZED Jakarta Persistence (JPA) Enum Constant in jakarta. persistence .SynchronizationType SYNCHRONIZED Persistence context is automatically synchronized with the current transaction Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.SynchronizationType.UNSYNCHRONIZED Jakarta Persistence (JPA) Enum Constant in jakarta. persistence .SynchronizationType UNSYNCHRONIZED Persistence context must be explicitly joined to the current transaction Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.NamedQuery.lockMode.NONE is specified, the query must be executed in a transaction and the persistence context joined to the transaction. Default: LockModeType.NONE Since: Jakarta Persistence (JPA) 2.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence .NamedQuery LockModeType lockMode (Optional | |
jakarta.persistence.EntityManager.remove(Object) the database when the persistence context is synchronized with the database. This operation cascades ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void remove (   ... - if invoked on a container-managed entity manager of type PersistenceContextType.TRANSACTION and there is no transaction. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.find(Class,Object) of the specified class and primary key. If the entity instance is contained in the persistence context ... Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager T find ( Class ... for that entity's primary key or is null. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.EntityManager.flush() Jakarta Persistence (JPA) Method in jakarta. persistence .EntityManager void flush() Synchronize changes held in the persistence context to the underlying database. Throws: PersistenceException ... has not been joined to the current transaction. Since: Jakarta Persistence (JPA) 1.0 |